

OBJS_API =  lib/api00.obj \
			lib/api01.obj \
			lib/api02.obj \
			lib/api03.obj \
			lib/api04.obj


TOOLPATH = ../../z_tools/
INCPATH  = ../../z_tools/haribote/

MAKE     = $(TOOLPATH)make.exe -r
NASK     = $(TOOLPATH)nask.exe
EDIMG    = $(TOOLPATH)edimg.exe
IMGTOL   = $(TOOLPATH)imgtol.com

COPY     = copy
DEL      = del

#编译c语言
CC1      = $(TOOLPATH)cc1.exe -I$(INCPATH) -Os -Wall -quiet
GAS2NASK = $(TOOLPATH)gas2nask.exe -a
OBJ2BIM  = $(TOOLPATH)obj2bim.exe
BIM2HRB  = $(TOOLPATH)bim2hrb.exe
RULEFILE = $(TOOLPATH)haribote/haribote.rul

#编译字体用到
MAKEFONT = $(TOOLPATH)makefont.exe
BIN2OBJ  = $(TOOLPATH)bin2obj.exe

#库管理器

GOLIB   = $(TOOLPATH)golib00.exe


default:
	$(MAKE) apilib.lib


apilib.lib:  Makefile $(OBJS_API)
	$(GOLIB) $(OBJS_API) out:apilib.lib


#编译C程序为hrb格式
#一般规则

%.gas: %.c Makefile
	$(CC1) -o $*.gas $*.c
%.nas: %.gas Makefile
	$(GAS2NASK) $*.gas $*.nas
%.obj: %.nas Makefile
	$(NASK) $*.nas $*.obj $*.lst				



cl:
	-$(DEL) apilib.lib
	$(MAKE) -C lib cl

